<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
    <title>人才联盟平台</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="{{URL::asset('index/css/public.css')}}" />
    <script src="{{ URL::asset('index/js/jquery-1.10.2.min.js')}}" type="text/javascript"></script>
    <script type="text/javascript" src="{{ URL::asset('index/js/superslide.2.1.js')}}"></script>
    <script type="text/javascript" src="{{ URL::asset('index/js/carouFredSel.js')}}"></script>
    <link rel="shortcut icon" href="{{asset('images/favicon.ico')}}" type="image/x-icon" />

    {{--layer引入--}}

    <script src="{{URL::asset('js/layer/layer.js')}}"></script>
</HEAD>

<body>

<div class="pt_w1200">

    @include('index.top')


    <div class="pt_mbx mar_t10">
        <a href="{{url('')}}">首页</a><i>></i>观众报名
    </div>

    <div class="pt_signup">
        <table width="100%" class="mar_t30">

            <form method="post" action="{{url('registration')}}" id="tab">
                {{csrf_field()}}
            <tr>
                <td width="100" align="right"><span class="red mar_r5">*</span>活动名称</td>
                <td>
                    <select name="article_id" id="modules">
                        <option value="-1">直接选择或搜索选择</option>
                        @foreach($announce as $k=>$v)
                            <option value="{{$v->id}}">{{$v->title}}</option>
                            @endforeach

                    </select>
                </td>

            </tr>
            <tr>
                <td width="100" align="right"><span class="red mar_r5">*</span>报名人</td>
                <td><input type="text" class="width_428" name="name"/></td>
            </tr>
            <tr>
                <td width="100" align="right"><span class="red mar_r5">*</span>联系电话</td>
                <td><input name="mobile" type="text" class="width_428" /></td>
            </tr>
            <tr>
                <td width="100" align="right">&nbsp;</td>
                <td><button  id="btn" type="button" class="pt_news_apply mar_t20 width_428">确定提交</button></td>
            </tr>
            </form>

        </table>
    </div>


    @include('index.link')


</div>

@include('index.contact')

</body>
<script type="text/javascript">

    $("#btn").click(function(){    // 提交按钮触发事件

//        console.log($("#tab").serialize());
//        return false ;

        var tourl = $("#tab").attr("action");    // 获取 表单的 提交地址
        // 序列化 表单数据 后提交 ，太简洁了
        $.post(tourl,$("#tab").serialize(),function(data){

            if(data.status_code==200){
                //消息框
                layer.msg('报名成功',{icon:6},function(){
                    location.href = "{{url('api/index')}}";
                });
            }else{
                layer.msg(data.msg,{icon:5});
            }


        });
    });


</script>

</html>